package cc.forgemod.customicon.client.texture;

import java.util.Collections;

import cc.forgemod.customicon.common.icon.IconManager;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class GifItemOverrideList extends ItemOverrideList {

    private TextureGifCIItem mTexture;

    public GifItemOverrideList(TextureGifCIItem pTexture) {
        super(Collections.EMPTY_LIST);

        this.mTexture = pTexture;
    }

    @Override
    public IBakedModel handleItemState(IBakedModel pOriginalModel, ItemStack pStack, World pWorld, EntityLivingBase pEntity) {
        return IconManager.getIcon(pStack) != null ? this.mTexture.getItemModelWithOverrides(pOriginalModel) : pOriginalModel;
    }

}
